-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cp: correct --verbose --parents output for both files and directories #4184
Conversation
9d904f6
to
3d08c6b
Compare
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
I guess the GNU regression is legit. could you please have a look? |
I think it is related to #3894 (comment) I will take a look. |
1b1f677
to
168837c
Compare
Okay, I've made a change to the second commit in this branch. By adding this condition: if source_absolute.is_dir()
&& !ends_with_slash_dot(&source_absolute)
&& !local_to_target.exists()
{ it should also fix #3897. |
GNU testsuite comparison:
|
I broke things by introducing some code to set the current working directory of the child process produced by |
GNU testsuite comparison:
|
GNU testsuite comparison:
|
This commit corrects the behavior of `cp --parents --verbose` when the source path is a file so that it prints the copied ancestor directories. For example, $ mkdir -p a/b d $ touch a/b/c $ cp --verbose --parents a/b/c d a -> d/a a/b -> d/a/b 'a/b/c' -> 'd/a/b/c' Fixes uutils#3332.
This commit corrects the behavior of `cp -r --parents --verbose` when the source path is a directory, so that it prints the copied ancestor directories. For example, $ mkdir -p a/b/c d $ cp -r --verbose --parents a/b/c d a -> d/a a/b -> d/a/b 'a/b/c' -> 'd/a/b/c'
This pull request corrects the behavior of
cp --parents --verbose
when the source path is a file and when the source path is a directory so that it prints the copied ancestor directories. For example,And
Fixes #3332.